<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<nav
	class="navbar navbar-expand-lg navbar-dark ftco_navbar bg-dark ftco-navbar-light"
	id="ftco-navbar">

	<div class="container">
		<img alt=""
			src="${pageContext.request.contextPath}/user/images/icon2.png"
			height="20px" width="20px"> <span id="address" class="nav-item">${Address.address}</span>
		<!--  <a class="navbar-brand" href="index-login">登录</a> -->
		<!-- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#ftco-nav" aria-controls="ftco-nav" aria-expanded="false" aria-label="Toggle navigation">
	        <span class="oi oi-menu"></span> 
	      </button> -->
		<div class="collapse navbar-collapse" id="ftco-nav">
			<ul class="navbar-nav ml-auto">

				<li class="nav-item"><a
					href="${pageContext.request.contextPath}/index" class="nav-link">首页</a></li>
				<li class="nav-item"><a
					href="${pageContext.request.contextPath}/about" class="nav-link">关于我们</a></li>
				<li class="nav-item"><a
					href="${pageContext.request.contextPath}/places" class="nav-link">地方</a></li>
				<li class="nav-item"><a
					href="${pageContext.request.contextPath}/userapi/getrestaurantbypage"
					class="nav-link">餐厅</a></li>
				<li class="nav-item"><a href="${pageContext.request.contextPath}/Userapi/getblogbypage" class="nav-link">博客</a></li>
				<c:if test="${empty users.uname && empty users}">
					<li class="nav-item"><a
						href="${pageContext.request.contextPath}/adminapi/dologin"
						class="nav-link">登录</a></li>
				</c:if>
				<c:if test="${not empty users.uname && !(users.uname eq null)}">
					<li class="nav-item"><a href="#" class="nav-link">您好：${users.uname}
							用户</a></li>
					<li class="nav-item"><a href="#" class="nav-link" id="exit">退出用户</a></li>
				</c:if>


			</ul>
		</div>
	</div>
</nav>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
	$(function() {

		$.ajax({
			url : "Userapi/getAddress",
			type : "get",
			dataType : "json",
			success : function(data) {
				//$("#address").html(data.address)
			}
		});

	});
</script>

<script type="text/javascript">
	$(function(){
		$("#exit").click(function(){
			$.ajax({
				url:"${pageContext.request.contextPath}/adminapi/exituser",
				success:function(data){
				location.reload();
				}
			});
		});
	});
</script>
